package com.xz.dao.impl;

import com.xz.bean.BTInfo;
import com.xz.dao.SearchDao;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2015/1/11 0011.
 */
public class SearchDaoImpl implements SearchDao {
    public SqlSessionTemplate sqlSession;

    @Override
    public List<BTInfo> listBt(String word, int offset, int length) {
        Map<String, java.io.Serializable> map = new HashMap<String, java.io.Serializable>();
        map.put("word", "%"+word+"%");
        map.put("offset", offset);
        map.put("length", length);
        return (List<BTInfo>) sqlSession.selectList(getClass().getName() + ".listBt", map);
    }

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }
}
